the similar fields on host_metrics, PIF_metrics, and VM_guest_metrics.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
crashdump.VM & VM.crash\_dumps & one-to-many\\
VIF.VM & VM.VIFs & one-to-many\\
VIF.network & network.VIFs & one-to-many\\
-host.metrics & host\_metrics.host & one-to-one\\
-PIF.metrics & PIF\_metrics.PIF & one-to-one\\
PIF.host & host.PIFs & one-to-many\\
PIF.network & network.PIFs & one-to-many\\
SR.VDIs & VDI.SR & many-to-one\\
Quals & Field & Type & Description \\
\hline
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
-$\mathit{RO}_\mathit{ins}$ & {\tt VM} & VM ref & VM to which these metrics apply \\
$\mathit{RO}_\mathit{run}$ & {\tt os\_version} & (string $\rightarrow$ string) Map & version of the OS \\
$\mathit{RO}_\mathit{run}$ & {\tt PV\_drivers\_version} & (string $\rightarrow$ string) Map & version of the PV drivers \\
$\mathit{RO}_\mathit{run}$ & {\tt memory} & (string $\rightarrow$ string) Map & free/used/total memory \\
}
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_VM}
-
-{\bf Overview:}
-Get the VM field of the given VM\_guest\_metrics.
-
- \noindent {\bf Signature:}
-\begin{verbatim} (VM ref) get_VM (session_id s, VM_guest_metrics ref self)\end{verbatim}
-
-
-\noindent{\bf Arguments:}
-
-
-\vspace{0.3cm}
-\begin{tabular}{|c|c|p{7cm}|}
- \hline
-{\bf type} & {\bf name} & {\bf description} \\ \hline
-{\tt VM\_guest\_metrics ref } & self & reference to the object \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-VM ref
-}
-
-
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
Quals & Field & Type & Description \\
\hline
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
-$\mathit{RO}_\mathit{ins}$ & {\tt host} & host ref & Host to which these metrics apply \\
$\mathit{RO}_\mathit{run}$ & {\tt memory/total} & int & Host's total memory (bytes) \\
$\mathit{RO}_\mathit{run}$ & {\tt memory/free} & int & Host's free memory (bytes) \\
\hline
}
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_host}
-
-{\bf Overview:}
-Get the host field of the given host\_metrics.
-
- \noindent {\bf Signature:}
-\begin{verbatim} (host ref) get_host (session_id s, host_metrics ref self)\end{verbatim}
-
-
-\noindent{\bf Arguments:}
-
-
-\vspace{0.3cm}
-\begin{tabular}{|c|c|p{7cm}|}
- \hline
-{\bf type} & {\bf name} & {\bf description} \\ \hline
-{\tt host\_metrics ref } & self & reference to the object \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-host ref
-}
-
-
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
Quals & Field & Type & Description \\
\hline
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
-$\mathit{RO}_\mathit{ins}$ & {\tt PIF} & PIF ref & PIF to which these metrics apply \\
$\mathit{RO}_\mathit{run}$ & {\tt io/read\_kbs} & float & Read bandwidth (KiB/s) \\
$\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB/s) \\
\hline
}
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_PIF}
-
-{\bf Overview:}
-Get the PIF field of the given PIF\_metrics.
-
- \noindent {\bf Signature:}
-\begin{verbatim} (PIF ref) get_PIF (session_id s, PIF_metrics ref self)\end{verbatim}
-
-
-\noindent{\bf Arguments:}
-
-
-\vspace{0.3cm}
-\begin{tabular}{|c|c|p{7cm}|}
- \hline
-{\bf type} & {\bf name} & {\bf description} \\ \hline
-{\tt PIF\_metrics ref } & self & reference to the object \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-PIF ref
-}
-
-
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
#define XEN_HOST_METRICS_H
#include "xen_common.h"
-#include "xen_host_decl.h"
#include "xen_host_metrics_decl.h"
{
xen_host_metrics handle;
char *uuid;
- struct xen_host_record_opt *host;
int64_t memory_total;
int64_t memory_free;
} xen_host_metrics_record;
xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics);
-/**
- * Get the host field of the given host_metrics.
- */
-extern bool
-xen_host_metrics_get_host(xen_session *session, xen_host *result, xen_host_metrics host_metrics);
-
-
/**
* Get the memory/total field of the given host_metrics.
*/
#define XEN_PIF_METRICS_H
#include "xen_common.h"
-#include "xen_pif_decl.h"
#include "xen_pif_metrics_decl.h"
{
xen_pif_metrics handle;
char *uuid;
- struct xen_pif_record_opt *pif;
double io_read_kbs;
double io_write_kbs;
} xen_pif_metrics_record;
xen_pif_metrics_get_uuid(xen_session *session, char **result, xen_pif_metrics pif_metrics);
-/**
- * Get the PIF field of the given PIF_metrics.
- */
-extern bool
-xen_pif_metrics_get_pif(xen_session *session, xen_pif *result, xen_pif_metrics pif_metrics);
-
-
/**
* Get the io/read_kbs field of the given PIF_metrics.
*/
#include "xen_common.h"
#include "xen_string_string_map.h"
-#include "xen_vm_decl.h"
#include "xen_vm_guest_metrics_decl.h"
{
xen_vm_guest_metrics handle;
char *uuid;
- struct xen_vm_record_opt *vm;
xen_string_string_map *os_version;
xen_string_string_map *pv_drivers_version;
xen_string_string_map *memory;
xen_vm_guest_metrics_get_uuid(xen_session *session, char **result, xen_vm_guest_metrics vm_guest_metrics);
-/**
- * Get the VM field of the given VM_guest_metrics.
- */
-extern bool
-xen_vm_guest_metrics_get_vm(xen_session *session, xen_vm *result, xen_vm_guest_metrics vm_guest_metrics);
-
-
/**
* Get the os_version field of the given VM_guest_metrics.
*/
/**
- * Return a list of all the VM_guest_metrics instances known to the system.
+ * Return a list of all the VM_guest_metrics instances known to the
+ * system.
*/
extern bool
xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result);
#include <stdlib.h>
#include "xen_common.h"
-#include "xen_host.h"
#include "xen_host_metrics.h"
#include "xen_internal.h"
{ .key = "uuid",
.type = &abstract_type_string,
.offset = offsetof(xen_host_metrics_record, uuid) },
- { .key = "host",
- .type = &abstract_type_ref,
- .offset = offsetof(xen_host_metrics_record, host) },
{ .key = "memory_total",
.type = &abstract_type_int,
.offset = offsetof(xen_host_metrics_record, memory_total) },
}
free(record->handle);
free(record->uuid);
- xen_host_record_opt_free(record->host);
free(record);
}
}
-bool
-xen_host_metrics_get_host(xen_session *session, xen_host *result, xen_host_metrics host_metrics)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = host_metrics }
- };
-
- abstract_type result_type = abstract_type_string;
-
- *result = NULL;
- XEN_CALL_("host_metrics.get_host");
- return session->ok;
-}
-
-
bool
xen_host_metrics_get_memory_total(xen_session *session, int64_t *result, xen_host_metrics host_metrics)
{
#include "xen_common.h"
#include "xen_internal.h"
-#include "xen_pif.h"
#include "xen_pif_metrics.h"
{ .key = "uuid",
.type = &abstract_type_string,
.offset = offsetof(xen_pif_metrics_record, uuid) },
- { .key = "PIF",
- .type = &abstract_type_ref,
- .offset = offsetof(xen_pif_metrics_record, pif) },
{ .key = "io_read_kbs",
.type = &abstract_type_float,
.offset = offsetof(xen_pif_metrics_record, io_read_kbs) },
}
free(record->handle);
free(record->uuid);
- xen_pif_record_opt_free(record->pif);
free(record);
}
}
-bool
-xen_pif_metrics_get_pif(xen_session *session, xen_pif *result, xen_pif_metrics pif_metrics)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = pif_metrics }
- };
-
- abstract_type result_type = abstract_type_string;
-
- *result = NULL;
- XEN_CALL_("PIF_metrics.get_PIF");
- return session->ok;
-}
-
-
bool
xen_pif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics)
{
#include "xen_common.h"
#include "xen_internal.h"
#include "xen_string_string_map.h"
-#include "xen_vm.h"
#include "xen_vm_guest_metrics.h"
{ .key = "uuid",
.type = &abstract_type_string,
.offset = offsetof(xen_vm_guest_metrics_record, uuid) },
- { .key = "VM",
- .type = &abstract_type_ref,
- .offset = offsetof(xen_vm_guest_metrics_record, vm) },
{ .key = "os_version",
.type = &abstract_type_string_string_map,
.offset = offsetof(xen_vm_guest_metrics_record, os_version) },
}
free(record->handle);
free(record->uuid);
- xen_vm_record_opt_free(record->vm);
xen_string_string_map_free(record->os_version);
xen_string_string_map_free(record->pv_drivers_version);
xen_string_string_map_free(record->memory);
}
-bool
-xen_vm_guest_metrics_get_vm(xen_session *session, xen_vm *result, xen_vm_guest_metrics vm_guest_metrics)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm_guest_metrics }
- };
-
- abstract_type result_type = abstract_type_string;
-
- *result = NULL;
- XEN_CALL_("VM_guest_metrics.get_VM");
- return session->ok;
-}
-
-
bool
xen_vm_guest_metrics_get_os_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics)
{
# ----------------------------------------------------------------
host_metrics_attr_ro = ['memory_total',
- 'memory_free',
- 'host']
+ 'memory_free']
host_metrics_attr_rw = []
host_metrics_methods = []
def host_metrics_get_record(self, _, ref):
return xen_api_success({
'uuid' : ref,
- 'host' : XendNode.instance().uuid,
'memory_total' : self._host_metrics_get_memory_total(),
'memory_free' : self._host_metrics_get_memory_free(),
})
- def host_metrics_get_host(self, _, ref):
- return xen_api_success(XendNode.instance().uuid)
-
def host_metrics_get_memory_total(self, _, ref):
return xen_api_success(self._host_metrics_get_memory_total())
# Xen API: Class PIF_metrics
# ----------------------------------------------------------------
- PIF_metrics_attr_ro = ['PIF',
- 'io_read_kbs',
+ PIF_metrics_attr_ro = ['io_read_kbs',
'io_write_kbs']
PIF_metrics_attr_rw = []
PIF_methods = []
def PIF_metrics_get_record(self, _, ref):
return xen_api_success(self._PIF_metrics_get(ref).get_record())
- def PIF_metrics_get_PIF(self, _, ref):
- return xen_api_success(self._PIF_metrics_get(ref).pif.uuid)
-
def PIF_metrics_get_io_read_kbs(self, _, ref):
return xen_api_success(self._PIF_metrics_get(ref).get_io_read_kbs())